// 引入react内置的hook
import React, { useState } from 'react'
import Test from './Test'
export default function App() {
  //定义状态
  const [count, setCount] = useState(1)

  return (
    <div>
      App
      <p>{count}</p>
      <button
        onClick={function () {
          // 作用: 修改count值 参数: 目标值
          setCount(0)
        }}
      >
        +
      </button>
      <hr />
      {/* {count && <Test></Test>} */}
      <Test count={count}></Test>
    </div>
  )
}
